package order;
import java.time.LocalDateTime;
import java.util.Map;
import java.util.TreeMap;

/*
*public void addOrder(Order order, LocalDateTime time)
* public void displayOrders()
* */
public class OrderManagementSystem {
    private TreeMap<LocalDateTime, Order> orderMap;

    public OrderManagementSystem() {
        this.orderMap = new TreeMap<>();
    }

    public void addOrder(Order order, LocalDateTime time){
        orderMap.put(time, order);
        System.out.println("添加订单: " + order + " at " + time);
    }

    public void displayOrders(){
        for (Map.Entry<LocalDateTime, Order> entry : orderMap.entrySet()) {
            System.out.println(entry.getKey() + " --> " + entry.getValue());
        }
    }
}
